#pragma once
#ifndef __LIT__NAME__MODIFIER__HH__
#define __LIT__NAME__MODIFIER__HH__

#include <LitPrerequisites.h>

namespace Lit
{
	struct LIT_API NameModifier
	{
		static const NameModifier Blank;
		static const NameModifier FilePath;

		std::string prefix;
		std::string suffix;
		std::string link;

		std::unordered_map<std::string,std::string> replaces;

		NameModifier( const std::string &prefix_ = "", const std::string &suffix_ = "", const std::string &link_ = "_" );
		NameModifier( const NameModifier& rk );
		NameModifier& operator=( const NameModifier& rk );
		~NameModifier( );
				
		bool operator==( const NameModifier& rk ) const;
		bool operator!=( const NameModifier& rk ) const;
				
		// treats whole string in what as a replacer
		NameModifier& setReplace( const std::string &what, const std::string &by = "" );
		// treats each letters in (what) as a different replacer, 
		// but replace what[i] with whole string in (by)
		NameModifier& setReplaceArray( const std::string &what, const std::string &by = "" );

		std::string replace( const std::string &source ) const;
		std::string operator()( const std::string &name, bool keep_empty_parts = false ) const;
		std::string generate( const std::string &name, bool keep_empty_parts = false ) const;
	};
};

#endif